package com.qf.shop.timer;

import cn.hutool.core.io.FileUtil;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.File;
@Component
public class ClearTempFile {
    private Logger logger = Logger.getLogger(ClearTempFile.class);

    @Value("${imageServerSaveAddress}")
    private String fileLocation;

    public void clearFiles() {
        logger.info("清除临时文件");

        FileUtil.clean(new File(fileLocation));
    }
}
